package intermediaireIntermediaire;

import java.rmi.*;
import java.rmi.registry.LocateRegistry;

public class ProgIntermediaire {
    public static void main(String[] argv) {
    	//arg0 le port utilise
    	
    	
	try {
		Intermediaire calculateur = new Intermediaire(argv[0],false);
		new Thread(calculateur).start();
		LocateRegistry.createRegistry(Integer.parseInt(argv[0]));
	    Naming.rebind("rmi://localhost:"+argv[0]+"/Service",calculateur);
	    System.out.println("intermediaire is ready.");
	} catch(Exception e) {
	    System.out.println("Slave failed: "+e);
	}
    }
}
